
<?php
  
  require_once('inc_admin.php');
  //连接数据库   
  connect();
   if(!empty($_FILES["zb_jiajulink"]["name"])){
    $pic = uploadfile('zb_jiajulink',UserPhotoPath,array('jpg','gif','png'));
  }
  else{
    $pic='';
  }
  $data = array(

    'zb_name' => $_POST['zb_name'], 
    'zb_jiajulink' => $pic,  
    'zb_brand' => $_POST['zb_brand'],
    'zb_adddate' => $_POST['zb_adddate'],
    'zb_intro' => $_POST['zb_intro']
    );
 //var_dump($data);
  //执行SQL语句
  $result = add('jiaju',$data);

  if(!$result){
    echo "添加失败！<br/>";
    echo "<a href='list.php'>返回</a>";   
  }else{    
  echo "添加成功！";
  echo "进入<a href='list.php'>家具列表</a>查看订单，";
  echo "或返回<a href='addjiaju.php'>增加订单</a>页面！";   
  }    
  
?>